import request from '@/utils/request'
/**
 * 获取简单员工信息
 * @returns
 */
export const getEmployees = () => {
  return request({
    url: '/api/sys/user/simple',
    method: 'get'
  })
}
/**
 * 获取员工基本信息
 * @returns {size:每页条数 page:当前页}
 */
export const getMes = (params) => {
  return request({
    url: '/api/sys/user',
    method: 'get',
    params
  })
}
/**
 * 删除员工
 * @returns {id}
 */
export const delEmployees = (id) => {
  return request({
    url: `/api/sys/user/${id}`,
    method: 'delete'
  })
}
/**
 * 添加员工
 * @returns {username,mobile,workNumber,departmentName,date1,date2}
 */
export const addEmployees = (data) => {
  return request({
    url: '/api/sys/user',
    method: 'POST',
    data
  })
}
/**
 * 批量导入员工
 * @returns {username,mobile,workNumber,departmentName,date1,date2}
 */
export const importEmployees = (data) => {
  return request({
    url: '/api/sys/user/batch',
    method: 'POST',
    data
  })
}
/**
 * 获取员工基本信息通过id
 * @returns {size:每页条数 page:当前页}
 */
export const getUserInfoById = (id) => {
  return request({
    url: `/api/sys/user/${id}`,
    method: 'get'
  })
}

/**
 * 保存员工基本信息 通过id更新
 * @returns {id,username,password}
 */
export const updateUserInfo = (data) => {
  return request({
    url: `/api/sys/user/${data.id}`,
    method: 'PUT',
    data
  })
}

